public class VarParameter {

    public static void main(String[] args) {

        HspMethod hspMethod = new HspMethod();
        System.out.println("1,2,3,4,5,6,7,8,9,10========>>>"+hspMethod.sum(1,2,3,4,5,6,7,8,9,10));

        System.out.println("1,2,3,4,5,6,7,8,9========>>>"+hspMethod.showScore("小明",2.1,23.11,98.22,99.22));

        Persondou per = new Persondou();
        per.say();
    }

}

class  HspMethod{

    public  int sum(int... num){
//        return num+=nu\;
        int res = 0;
        for (int i = 0; i < num.length; i++) {
            res+=num[i];
        }
        return res;
    }



    public String showScore(String name,double... score){
        double totalScore = 0;
        for (int i = 0; i < score.length; i++) {
            totalScore+=score[i];
        }
        return name+"的总分是："+totalScore;

    }


}


class Persondou extends  Person{
//    String name = "jack";

    public  void say(){
//        String  name = "小丑";
        System.out.println("我是"+name);
    }
}